package com.biz.primus.app.rest.feign;

import com.biz.primus.app.rest.degraded.DegradedCommodityFeignClient;
import com.biz.primus.base.vo.IdNameVo;
import com.biz.primus.base.vo.ProductFieldVo;
import com.biz.primus.commodity.vo.frontend.ProductRelevantDetail;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author jiangnan
 * @Description:
 */
@FeignClient(name = "service-commodity", fallback = DegradedCommodityFeignClient.class)
public interface CommodityFeignClient {

    @GetMapping("soa/categoryService/frontend/findAllCategoryForApp")
    List<IdNameVo> findAllCategoryForApp();

    @GetMapping("soa/brandService/frontend/listBrandByCategoryId")
    List<IdNameVo> listBrandByCategoryId(@RequestParam("categoryId") Long categoryId);

    @GetMapping("soa/extendService/findFieldByCategoryId")
    List<ProductFieldVo> findFieldByCategoryId(@RequestParam(value = "categoryId",required = false) Long categoryId);

    @GetMapping("soa/commodityService/getRelevant")
    List<ProductRelevantDetail> getRelevant(@RequestParam("productId") Long productId);


}
